package initization

import (
	"api/tools"
	"go.uber.org/zap"
)

func init() {
	ZapInit()
	ConsulInit()
}
func ZapInit() {
	con := zap.NewDevelopmentConfig()
	con.OutputPaths = []string{
		"./srv.log",
		"stdout",
	}
	build, _ := con.Build()
	zap.ReplaceGlobals(build)
}
func ConsulInit() {
	consul := tools.NewConsul("117.27.231.246", 8500)
	err := consul.RegisterConsul("carsrv", "127.0.0.1", 3306, []string{"123"})
	if err != nil {
		zap.S().Error("注册失败")
		return
	}
	zap.S().Info("注册成功")
}
